﻿using Newbe.MPQ.Framework;

namespace Newbe.MPQ.Plugins.Parrot
{
    public class ParrotPlugin : PluginBase
    {
        /// <summary>
        /// 插件说明
        /// </summary>
        /// <returns></returns>
        public override string GetInfo() => "Newbe.MPQ.Plugins.Parrot";

        public ParrotPlugin(IMyPcqqApi myPcqqApi) : base(myPcqqApi)
        {
        }

        /// <summary>
        /// 处理EventFun
        /// </summary>
        /// <param name="receiverQq"></param>
        /// <param name="eventType"></param>
        /// <param name="eventAdditionType"></param>
        /// <param name="fromNum"></param>
        /// <param name="eventOperator"></param>
        /// <param name="triggee"></param>
        /// <param name="message"></param>
        /// <param name="rawMessage"></param>
        /// <returns></returns>
        public override int EventFun(string receiverQq, int eventType, int eventAdditionType, string fromNum,
            string eventOperator,
            string triggee, string message, string rawMessage)
        {
            if (eventType == 1)
            {
                //将消息回发给发送者
                MyPcqqApi.Api_SendMsg(receiverQq, 1, 0, string.Empty, fromNum, message);
            }
            return base.EventFun(receiverQq, eventType, eventAdditionType, fromNum, eventOperator, triggee, message,
                rawMessage);
        }
    }
}